---
id: 65689b055e6f49ac6f82d3cf
title: الخطوة 20
challengeType: 20
dashedName: step-20
---

# --description--

When you would pass your input puzzle board, `0` would be used for empty cells.

For a better visual representation, replace the empty cells in a row with a space using the `replace` method.

The `replace()` method takes two arguments, the first one is the character to be replaced and the second one is the character to be replaced with.

After replacing, assign the result to a variable `row_empty`.

# --hints--

You should replace each `0` in the row with a space using the `replace` method.

```js
({ test: () => assert.match(code, /row\.replace\s*\(\s*("|')0\1\s*,\s*("|') \2\s*\)/) })
```

You should have `row_empty = row.repalce('0', ' ')` within the outermost `for` loop.

```js
({ test: () => assert.match(code, /row_empty\s*=\s*row\.replace\s*\(\s*("|')0\1\s*,\s*("|') \2\s*\)/m) })
```

# --seed--

## --seed-contents--

```py
class Board:
    def __init__(self, board):
        self.board = board

    def __str__(self):
        upper_lines = f'\n╔═══{"╤═══"*2}{"╦═══"}{"╤═══"*2}{"╦═══"}{"╤═══"*2}╗\n'
        middle_lines = f'╟───{"┼───"*2}{"╫───"}{"┼───"*2}{"╫───"}{"┼───"*2}╢\n'
        lower_lines = f'╚═══{"╧═══"*2}{"╩═══"}{"╧═══"*2}{"╩═══"}{"╧═══"*2}╝\n'
        board_string = upper_lines

        for index, line in enumerate(self.board):
            row_list = []
            for square_no, part in enumerate([line[:3], line[3:6], line[6:]], start=1):
                row_square = '|'.join(str(item) for item in part)
                row_list.extend(row_square)

                if square_no != 3:
                    row_list.append('║')

--fcc-editable-region--
            row = f'║ {" ".join(row_list)} ║\n'

--fcc-editable-region--
```
